import { Pipe } from './typings/Pipe';

const pipeMap = new Map<string, Pipe>();

/**
 * 简单的DI container
 */

export const container = {
  addPipe(name: string, instance: Pipe) {
    pipeMap.set(name, instance);
  },

  // 获取一个Pipe
  getPipe(name: string) {
    return pipeMap.get(name);
  }
}
